<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GBK">
<script src="js/jquery.js"></script>
</head>

<body>
<div id="msg"></div>
<input type="button" name="test_ajax"  value="test_ajax" onclick="test2()">

<script>
 function test(){

   $.ajax({
	   type:"get", 
	   url: "test", 
	   data:"url=ffffffff", 
	   dataType:"html", 
	   
	   success:function (data) {
		alert(data);
	   }
	});
 }

 function test2(){

	   $.ajax({
		   type:"get", 
		   url: "test", 
		   data:"url=ffffffff", 
		   dataType:"json", 
		   
		   success:function (data) {
			alert(data.name);
		   }
		});
	 }

$("#msg").ajaxStart(function(){  
	  //TODO
	 });
 $("#msg").ajaxSuccess(function(){  
	 alert("over")
	//TODO
 }); 
</script>
</body>